@extends('adminlte::page')

@section('title', '留言列表')

@section('content_header')
    {{--<h1></h1>--}}
@stop

@section('content')
    <div class="box">
        <div class="box-header with-border">
            <h3 class="box-title">留言列表</h3>
            {{--<div class="box-tools">--}}
                {{--<div class="input-group input-group-sm" style="width: 150px;">--}}
                    {{--<a href="{{ route('carousel.add') }}"><button type="button" class="btn btn-block btn-primary">添加轮播图</button></a>--}}
                {{--</div>--}}
            {{--</div>--}}
        </div>
        <!-- /.box-header -->
        <div class="box-body">
            <table class="table table-bordered">
                <tbody><tr>
                    <th>ID</th>
                    <th>标题</th>
                    <th>详情</th>
                    <th>名称</th>
                    <th>手机</th>
                    <th>email</th>
                    <th>
                        操作
                    </th>
                </tr>
                @foreach($messages as $msg)
                    <tr>
                        <td>
                            {{ $loop->iteration }}
{{--                            {{ $msg->title }}--}}
                        </td>

                        <td>
                            {{ $msg->title }}
                        </td>

                        <td>
                            {{ $msg->detail }}
                        </td>

                        <td>
                            {{ $msg->name }}
                        </td>

                        <td>
                            {{ $msg->phone }}
                        </td>

                        <td>
                            {{$msg->email}}
                        </td>

                        <td>
                            <a type="button" class="btn btn-block btn-danger btn-flat" onclick="if (!confirm('确定要删除吗?')) { return false }"  href="{{ route('messages.delete', ['msg'=>$msg->id]) }}" >
                                删除
                            </a>
                        </td>
                    </tr>
                @endforeach

                </tbody></table>
        </div>
    </div>
@stop